# Contributor: Steve McMaster <code@mcmaster.io>
# Maintainer: Steve McMaster <code@mcmaster.io>
pkgname=ledmon
pkgver=1.0.0
pkgrel=0
pkgdesc="Enclosure LED Utilities"
url="https://github.com/intel/ledmon"
arch="all"
# Provided tests expect to run on a host with supported hardware
options="!check"
license="GPL-2.0-only"
makedepends="automake autoconf eudev-dev libtool linux-headers pciutils-dev sg3_utils-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/intel/ledmon/archive/v$pkgver.tar.gz
	10-musl-build.patch
	gcc14-configure.patch
	gcc14-basename.patch
	gcc14-type-32-bit.patch
	"
subpackages="$pkgname-doc"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
af4dcfaf0284cfc5d88f09d2b4974514f40901c26c640a12ba4ae9bbe16e29e0ca975bc413cf155996162b324b5d365e7bc0306db0329aa755df690ac541a3a6  ledmon-1.0.0.tar.gz
d25dc45306d8d714430c69c7ec04f9a4f8388d93b2a129431cf3eb1a73bbc754de4e7503c025f9be3719c337aa342571678688c175c6716a2dd1bc7b2c211c9e  10-musl-build.patch
f397ac01a8a73d6f454ce507cedec490c75dc929b2f848c655c8c73adb8e23d98bbadbf9baddbbad6a9081e577639db349e6b622d543f9a60c81079246e11b35  gcc14-configure.patch
77bd6a96ee312484bb33bb7b0e83b8c23c5bbb63e2af5312cbc4fe22a5ae4b46b11f13ce9f483d81894f96ff8945cafe747f361780c043c35ab4450340aff9db  gcc14-basename.patch
d4907c65418a26a0ad94524362639470db6592abaf65a9c6077d94426cfc5e9beed074ede375a473fbbf5fd0b165651c484dd2e089b96fc2a54abd1adaa3ad80  gcc14-type-32-bit.patch
"
